<?php
require_once './config/sys_config.php';
require_once MB_APP_DIR  . '/global.class.php';
require_once MB_VIEW_DIR . '/template_view.class.php';
require_once 'GuestAPI.php';

$logger = new MBLog($mbConfig["log_path"], "login", false);
MBGlobal::setLogger($logger);

function formatUserList($arr){
	if($arr["count"]==0){
		return array();
	};
	foreach($arr["list"] as $i => $u){
		try{
			$g=new GuestAPI();
			$user=$g->getUserInfo($u["uname"]);
		}catch(Exception $e){
			$user["nick"]="拉取信息失败";
			$user["head"]="";
		}
		$arr["list"][$i]["nick"] = $user["nick"];
		$arr["list"][$i]["head"] = ($user["head"]==""?"style/images/default_head_small.png":$user["head"]."/50");
	}
	return $arr;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>微播长沙</title>
		<style type="text/css">
		<!--
		body {margin: 0px;background:url(style/images/login/background_pic.gif) repeat-x #73CFF1;font-size:12px;color:#000;	font-family:"宋体",verdana;}
		.bk11 {
			border-top-width: 0px;
			border-right-width: 0px;
			border-bottom-width: 1px;
			border-left-width: 0px;
			border-top-style: dashed;
			border-right-style: dashed;
			border-bottom-style: dashed;
			border-left-style: dashed;
			border-top-color: #DFDFDB;
			border-right-color: #DFDFDB;
			border-bottom-color: #DFDFDB;
			border-left-color: #DFDFDB;
		}
		.f7 {color:#333333;font-size: 14px;line-height: 22px;}
		.f8 {color:#999999;font-size: 12px;line-height: 24px;}
		.input1 {
			width:165px;
			height:26px;
			font-size:12px;
			color:#999999;
			background-image:url(style/images/login/input.gif);
			text-indent: 8px;
			line-height: 24px;
			border-top-style: none;
			border-right-style: none;
			border-bottom-style: none;
			border-left-style: none;
			margin: 0px;
			text-decoration: none;
			border:0;
		}
		.f12 {
			color:#999999;
			line-height: 18px;
		}
		-->
		</style>
		<link rel="stylesheet" type="text/css" href="style/images/login/css1.css">
		
		<script type="text/javascript" src="./js/third-party/jquery/jquery-1.4.4.min.js"></script>
		<script type="text/javascript">
			$(function(){
				setInterval(ajaxGetCityBroadcast, 10000);
			});
			
			function ajaxGetCityBroadcast(){
				$.ajax({
					type: "POST",
					url: "ajax_get_data.php",
					data: "a=cb&k=长沙&n=20",
					success: function(html){
						if ($('#city_broadcast_1').is(':visible')) {
							$('#city_broadcast_2').html(html);
							$("#city_broadcast_1").hide(0);
							$("#city_broadcast_2").show(0);
						}else{
							$('#city_broadcast_1').html(html);
							$("#city_broadcast_2").hide(0);
							$("#city_broadcast_1").show(0);
						}
					}
				});
			}
		</script>
	</head>
	<body>
		<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
			<tr>
				<td><img src="style/images/login/banner.jpg" width="1002" height="198" /></td>
			</tr>
		</table>
		<?php
			//顶部导航
			require_once pathJoin( TEMPLATE_DIR, 'login', 'top_navigation.view.php' );
		?>
		<table width="960" border="0" align="center" cellpadding="0" cellspacing="0" background="style/images/login/5_18.gif" bgcolor="#FFFFFF">
			<tr>
				<td width="632" align="left" valign="top">
					<?php
						//主区域推荐位
						require_once pathJoin( TEMPLATE_DIR, 'login', 'main_recomm.view.php' );
					?>
					<?php
						//主区域话题
						require_once pathJoin( TEMPLATE_DIR, 'login', 'main_topic.view.php' );
					?>
					<?php
						//主区域广播
						require_once pathJoin( TEMPLATE_DIR, 'login', 'main_broadcast.view.php' );
					?>
				</td>
				<td colspan="2" align="right" valign="top">
					<?php
						//右侧登录区域
						require_once pathJoin( TEMPLATE_DIR, 'login', 'right_login.view.php' );
					?>
					<?php
						//右侧微话题
						require_once pathJoin( TEMPLATE_DIR, 'login', 'right_topic_wei.view.php' );
					?>
					<?php
						//右侧每日推荐
						require_once pathJoin( TEMPLATE_DIR, 'login', 'right_recomm_today.view.php' );
					?>
					<?php
						//右侧机构设置
						require_once pathJoin( TEMPLATE_DIR, 'login', 'right_organization.view.php' );
					?>
					<?php
						//右侧热门话题排行
						require_once pathJoin( TEMPLATE_DIR, 'login', 'right_topic_hot.view.php' );
					?>
					<?php
						//右侧人气推荐
						require_once pathJoin( TEMPLATE_DIR, 'login', 'right_recomm_popular.view.php' );
					?>
				</td>
			</tr>
			<tr>
				<td height="79" colspan="3" align="left" valign="top" background="style/images/login/background_pic_64.gif">&nbsp;</td>
			</tr>
		</table>
		<?php
			//友情链接
			require_once pathJoin( TEMPLATE_DIR, 'login', 'bottom_links.view.php' );
		?>
	</body>
</html>
